package com.own.testapp.module;

import android.app.ActivityManager;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.own.testapp.R;
import com.own.testapp.base.BaseActivity;
import com.own.testapp.model.MyResponse;
import com.own.testapp.utils.UIHelper;

public class MainActivity extends BaseActivity
{
    private MyResponse myResponse;
    private Bundle mBundle;
    private TextView sample_text;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        sample_text = (TextView) findViewById(R.id.sample_text);

        mBundle = getIntent().getExtras();
        if (null != mBundle){
            myResponse = (MyResponse) mBundle.getSerializable("data");
            sample_text.setText("返回码："+myResponse.getCode()+"--"+myResponse.getMsg()+"--"+myResponse.getData().getDes()+"--请求url:"+myResponse.getData().getUrl());
        }

        ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
        int largeMemoryClass = activityManager.getMemoryClass();

    }

    /**
     * 退出登录
     * @param view
     */
    public void onLoginOut(View view){
        UIHelper.startActivityWithNewTask(mCotext,LoginActivity.class);
    }

    @Override
    public void onTrimMemory(int level)
    {
        super.onTrimMemory(level);
    }
}
